<?php

namespace app\saas\command;

use app\common\util\Tools;
use think\console\Input;
use think\console\Output;
use think\facade\Log;

class PassportTest extends CommonTest
{

    //再命令窗口中执行“php think interface-PassportTest”
    protected function configure()
    {
        $this->setName('interface-saasLoginTest')
            ->setDescription('接口测试');
    }

    public function execute(Input $input, Output $output)
    {
        parent::execute($input, $output);

        //Route::any('saas/role/getAdminInfo', 'saas/passport/getInfo');                                                        // 获取登录信息
        $data = Tools::curl($this->url . "saas/role/getAdminInfo", json_encode(["token" => "$this->token",]));
        Log::write("post". var_export($data,true));
        echo $data . "\n";

        //Route::any('saas/sendCode', 'saas/attach/doSendSms');                                                                  // 发送验证码
        $data = Tools::curl($this->url . "saas/sendCode", json_encode(["token" => "$this->token", "mobile" => "13682727574"]));
        Log::write("post". var_export($data,true));
        echo $data . "\n";
    }
}
